
package com.walkingfiles.alfresco

import com.walkingfiles.alfresco.AlfrescoServiceConnection

class Utils {

    def alfrescoConfig

    def Utils(alfrescoConfig) {
        this.alfrescoConfig = alfrescoConfig
    }

    def rootPathForDocument(documentInstance) {
        return "${alfrescoConfig.rootPath}/${documentInstance.getNumber()}"
    }

    def getClient() {
        def user = alfrescoConfig.credentials.user
        def password = alfrescoConfig.credentials.password
        def alfConnection = new AlfrescoServiceConnection(alfrescoConfig)
        alfConnection.getClient(user, password)
    }
    
}

